/*
 * Copyright 2012 ITC Tsinghua University. All Rights Reserved.
 */
package cn.edu.tsinghua.cic.ccss.entity;

import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
import javax.persistence.Version;

import org.forten.core.entity.rdb.hibernate.HibernateEntityWithCurrentTimeId;
import org.forten.utils.common.DateUtil;
import org.forten.utils.common.StringUtil;
import org.hibernate.annotations.Cache;
import org.hibernate.annotations.CacheConcurrencyStrategy;

/**
 * 
 * 
 * @author <a href="mailto:du_yi@bbn.cn">Duyi</a>
 * 
 * @since 2012-5-8
 */
@Entity
@Table(name = "THRS_GBGL_GBXXB")
@Cache(region = "cadreCache", usage = CacheConcurrencyStrategy.READ_WRITE)
public class Cadre extends HibernateEntityWithCurrentTimeId {
	private static final long serialVersionUID = 565651314976753475L;

	@Column(name = "GZZH")
	private String cardNum;
	@Column(name = "MZ")
	private String nation;
	@Column(name = "CSRQ")
	private String birthday;
	@Column(name = "XL")
	private String education;
	@Column(name = "DP")
	private String party;
	@Column(name = "GZZH_MD5")
	private String cardNumMD5;
	@Column(name = "XM")
	private String name;
	@Column(name = "XM_MD5")
	private String nameMD5;
	@Column(name = "XB")
	private String sex;
	@Column(name = "YXBC")
	private String unitName;
	@Column(name = "ZWJB")
	private String jobLevel;
	@Column(name = "ZWJB_MD5")
	private String jobLevelMD5;
	@Column(name = "ZC")
	private String titles;
	@Column(name = "ZW")
	private String duty;
	@Column(name = "RZSJ")
	private String postTime;
	@Column(name = "EMAIL")
	private String email;
	@Column(name = "SJ")
	private String mobileNum;
	@Column(name = "BGDH")
	private String officeTel;

	@Column(name = "DYYXXF")
	private int currentMonthTotalCredit;
	@Column(name = "XYYXXF")
	private int nextMonthTotalCredit;
	@Column(name = "SFXR")
	private String isNewFlag;

	@Column(name = "BZ")
	private String memo;
	@Column(name = "CJSJ")
	private Date createTime;
	@Version
	@Column(name = "VERSION")
	private int version;

	public Cadre() {
		super();
		this.currentMonthTotalCredit = 0;
		this.nextMonthTotalCredit = 0;
		this.isNewFlag = "0";
		this.createTime = DateUtil.currentTime();
	}

	/**
	 * @return the cardNum
	 */
	public String getCardNum() {
		return cardNum;
	}

	/**
	 * @param cardNum
	 *            the cardNum to set
	 */
	public void setCardNum(String cardNum) {
		this.cardNum = cardNum;
	}

	/**
	 * @return the cardNumMD5
	 */
	public String getCardNumMD5() {
		return cardNumMD5;
	}

	/**
	 * @param cardNumMD5
	 *            the cardNumMD5 to set
	 */
	public void setCardNumMD5(String cardNumMD5) {
		this.cardNumMD5 = cardNumMD5;
	}

	/**
	 * @return the name
	 */
	public String getName() {
		return name;
	}

	/**
	 * @param name
	 *            the name to set
	 */
	public void setName(String name) {
		this.name = name;
	}

	/**
	 * @return the nameMD5
	 */
	public String getNameMD5() {
		return nameMD5;
	}

	/**
	 * @param nameMD5
	 *            the nameMD5 to set
	 */
	public void setNameMD5(String nameMD5) {
		this.nameMD5 = nameMD5;
	}

	/**
	 * @return the sex
	 */
	public String getSex() {
		return sex;
	}

	/**
	 * @param sex
	 *            the sex to set
	 */
	public void setSex(String sex) {
		this.sex = sex;
	}

	public String getNation() {
		return nation;
	}

	public void setNation(String nation) {
		this.nation = nation;
	}

	public String getBirthday() {
		return birthday;
	}

	public void setBirthday(String birthday) {
		this.birthday = birthday;
	}

	public String getEducation() {
		return education;
	}

	public void setEducation(String education) {
		this.education = education;
	}

	public String getParty() {
		return party;
	}

	public void setParty(String party) {
		this.party = party;
	}

	/**
	 * @return the unitName
	 */
	public String getUnitName() {
		return unitName;
	}

	/**
	 * @param unitName
	 *            the unitName to set
	 */
	public void setUnitName(String unitName) {
		this.unitName = unitName;
	}

	/**
	 * @return the jobLevel
	 */
	public String getJobLevel() {
		return jobLevel;
	}

	/**
	 * @param jobLevel
	 *            the jobLevel to set
	 */
	public void setJobLevel(String jobLevel) {
		this.jobLevel = jobLevel;
	}

	/**
	 * @return the jobLevelMD5
	 */
	public String getJobLevelMD5() {
		return jobLevelMD5;
	}

	/**
	 * @param jobLevelMD5
	 *            the jobLevelMD5 to set
	 */
	public void setJobLevelMD5(String jobLevelMD5) {
		this.jobLevelMD5 = jobLevelMD5;
	}

	/**
	 * @return the email
	 */
	public String getEmail() {
		return email;
	}

	/**
	 * @param email
	 *            the email to set
	 */
	public void setEmail(String email) {
		this.email = email;
	}

	/**
	 * @param postTime
	 *            the postTime to get
	 */
	public String getPostTime() {
		return postTime;
	}

	/**
	 * @param postTime
	 *            the postTime to get
	 */
	public void setPostTime(String postTime) {
		this.postTime = postTime;
	}

	/**
	 * @return the mobileNum
	 */
	public String getMobileNum() {
		return mobileNum;
	}

	/**
	 * @param mobileNum
	 *            the mobileNum to set
	 */
	public void setMobileNum(String mobileNum) {
		this.mobileNum = mobileNum;
	}

	/**
	 * @return the officeTel
	 */
	public String getOfficeTel() {
		return officeTel;
	}

	/**
	 * @param officeTel
	 *            the officeTel to set
	 */
	public void setOfficeTel(String officeTel) {
		this.officeTel = officeTel;
	}

	/**
	 * @return the memo
	 */
	public String getMemo() {
		return memo;
	}

	/**
	 * @param memo
	 *            the memo to set
	 */
	public void setMemo(String memo) {
		this.memo = memo;
	}

	public Date getCreateTime() {
		return createTime;
	}

	public int getVersion() {
		return version;
	}

	public void setVersion(int version) {
		this.version = version;
	}

	/**
	 * @return the duty
	 */
	public String getDuty() {
		return duty;
	}

	/**
	 * @param duty
	 *            the duty to set
	 */
	public void setDuty(String duty) {
		this.duty = duty;
	}

	/**
	 * @return the currentMonthTotalCredit
	 */
	public int getCurrentMonthTotalCredit() {
		return currentMonthTotalCredit;
	}

	/**
	 * @param currentMonthTotalCredit
	 *            the currentMonthTotalCredit to set
	 */
	public void setCurrentMonthTotalCredit(int currentMonthTotalCredit) {
		this.currentMonthTotalCredit = currentMonthTotalCredit;
	}

	/**
	 * @return the nextMonthTotalCredit
	 */
	public int getNextMonthTotalCredit() {
		return nextMonthTotalCredit;
	}

	/**
	 * @param nextMonthTotalCredit
	 *            the nextMonthTotalCredit to set
	 */
	public void setNextMonthTotalCredit(int nextMonthTotalCredit) {
		this.nextMonthTotalCredit = nextMonthTotalCredit;
	}

	/**
	 * @return the isNewFlag
	 */
	public String getIsNewFlag() {
		return isNewFlag;
	}

	/**
	 * @param isNewFlag
	 *            the isNewFlag to set
	 */
	public void setIsNewFlag(String isNewFlag) {
		this.isNewFlag = isNewFlag;
	}

	/**
	 * @return the titles
	 */
	public String getTitles() {
		return titles;
	}

	/**
	 * @param titles
	 *            the titles to set
	 */
	public void setTitles(String titles) {
		if (StringUtil.hasText(titles))
			this.titles = titles.trim();
		else
			this.titles = "";
	}
}
